Filter hook 'rest_prepare_{$this->post_type}'
in WP Core File wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php at line 2046
Description
Filters the post data for a REST API response. The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. Possible hook names include: - `rest_prepare_post` - `rest_prepare_page` - `rest_prepare_attachment`
Occurrences
Filename |
Line Number |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php |
2046 |
Parameters
Type |
Name |
Description |
WP_REST_Response |
$response |
The response object. |
WP_Post |
$post |
Post object. |
WP_REST_Request |
$request |
Request object. |
PHP Doc
/**
* Filters the post data for a REST API response.
*
* The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug.
*
* Possible hook names include:
*
* - `rest_prepare_post`
* - `rest_prepare_page`
* - `rest_prepare_attachment`
*
* @since 4.7.0
*
* @param WP_REST_Response $response The response object.
* @param WP_Post $post Post object.
* @param WP_REST_Request $request Request object.
*/